#pragma once
#include<iostream>
#include<string>
using namespace std;

struct Node
{
	Node* left = NULL;
	Node* right = NULL;
	char data;
	int weight;
};

using HNode = Node*;

//built huffman tree
HNode builtHuffman(int n,int arr[], char arr1[]);

//generate huffman codes
void generateCodes(HNode root, string str, string codes[]);

//print the codes
void printHuffmanCodes(string codes[], char arr1[]);
